<%@ page import="com.work.service.TeacherService" %>
<%@ page import="com.work.service.impl.TeacherServiceImpl" %>
<%@ page import="com.work.bean.Hw" %>
<%@ page import="java.util.List" %>
<%@ page import="com.work.service.HwService" %>
<%@ page import="com.work.service.impl.HwServiceImpl" %>
<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: 17728
  Date: 2020/10/15
  Time: 12:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<html>
<head>
    <title>Title</title>
    <%@ include file="/pages/common/head.jsp" %>
    <style type="text/css">
        html, body {
            margin: 0;
            padding: 0;
        }

        .a {
            width: 80vw;
            margin: 0 auto;
            position: relative;
            top: 70px;
        }

        #bottom {
            width: 100%;
            height: 180px;
            position: fixed;
            bottom: 0;
            background-color: #2A2730;
            color: #FFFFFF;
        }

        #bottom p {
            text-align: center;
        }
    </style>

</head>

<body onload="fun()">
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">&nbsp;&nbsp;&nbsp;作业棒&nbsp;&nbsp;&nbsp;</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">

                <li><a href="NoticeServlet?action=page&pageNo=1">学生界面</a></li>
                <li class="active"><a href="HwServlet?action=queryHwStu">下载作业<span class="sr-only">(current)</span></a>
                </li>
                <li><a href="HwServlet?action=queryHw">提交作业</a></li>
                <li><a href="StudentServlet?action=query">个人信息</a></li>
                <li><a href="pages/student/student_change.jsp">修改密码</a></li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                <li><a href="UserServlet?action=logout">&nbsp;&nbsp;&nbsp;退出&nbsp;&nbsp;&nbsp;</a></li>


            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<div class="a">
    <table class="table table-hover">
        <thead>
        <tr>
            <td colspan="6" align="center"><h3>
                <c:choose>
                    <c:when test="${sessionScope.teacher != null && sessionScope.student == null}"><!-- 如果 -->
                    </c:when>
                    <c:otherwise> <!-- 否则 -->
                        <c:choose>
                            <c:when test="${sessionScope.student == null}"><!-- 如果 -->
                                完善个人信息，否则无法进行操作！
                            </c:when>
                            <c:otherwise>你好，${sessionScope.student.sname}同学，这是老师布置的作业</c:otherwise>
                        </c:choose>
                    </c:otherwise>
                </c:choose>
            </h3></td>
        </tr>
        <tr>
            <td align="center">教师</td>
            <td align="center">标题</td>
            <td align="center">描述</td>
            <td align="center">结束时间</td>
            <td align="center">点击下载</td>
            <td></td>
        </tr>
        </thead>
        <c:forEach items="${requestScope.tHws}" var="tHws">
            <tr>

                <td align="center">${tHws.name}</td>
                <td align="center">${tHws.title}</td>
                <td align="center">${tHws.describe}</td>
                <td align="center">${tHws.end_time}</td>
                <td align="center"><a href="HwServlet?action=downloadHw&id=${tHws.id}">下载</a></td>
            </tr>
        </c:forEach>
    </table>
</div>
<%@include file="/pages/common/footer.jsp" %>
</body>
</html>
